<?php
class Admin_Form_Server extends Zend_Form
{
   public function init()
    {
       $this->setAction ( '' )
          ->setMethod ( 'post' );
      
      $name_server= $this->createElement ( 'text', 'name' );
      $name_server->addValidator ( 'StringLength', false, array (1 , 255) )
            ->setRequired(true)
			->addFilter('StripTags')
			->addFilter('StringTrim')
			->setAttrib('size',50)
			->addValidator('NotEmpty')
            ->setLabel('Tên danh mục');
            
      $url= $this->createElement ( 'text', 'url_server' );
      $url->addValidator ( 'StringLength', false, array (0 , 255) )
            ->setRequired(false)
			->addFilter('StripTags')
			->addFilter('StringTrim')
			->setAttrib('size',50)
            ->setLabel('Đường links');
				
	  $status = $this->createElement('checkbox','status',array('label' => 'Sử dụng:','checkedValue' => 1,'uncheckedValue' => 0));
	  $status->setValue(1);
	  
      $submit = $this->createElement('submit', 'submit');
      $submit->setAttrib('id', 'submit');
      $submit->setLabel('Submit');
      $submit->setAttrib('class', 'formbutton');   
      $submit->setDecorators(array( 'ViewHelper', array('HtmlTag', array('tag' => 'hb') ,array('Label', array('tag' => '')))));      
      $reset = $this->createElement('reset','reset',array ('label' => 'Làm lại'));          
      $reset->setDecorators(array( 'ViewHelper', array('HtmlTag', array('tag' => 'hb') ,array('Label', array('tag' => '')))));      
      $reset->setAttrib('class', 'formbutton');   
      $cancel = $this->createElement('button','back',array ('label' => 'Quay lại'));
      $cancel->setDecorators(array( 'ViewHelper', array('HtmlTag', array('tag' => 'hb') ,array('Label', array('tag' => '')))));
      $cancel->setAttrib('class', 'formbutton');     
      // Add elements to form:
      $this->addElement ( $name_server )
          ->addElement ( $url )   
          ->addElement ( $status ) 
          ->addElement($submit)
          ->addElement($reset)
          ->addElement($cancel);
    }
}